package com.siwei.mes.mapper.experiment;

import com.siwei.mes.common.base.BaseMapper;
import com.siwei.mes.entity.experiment.ExperimentYearConfig;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 试验委托当年配置记录(ExperimentYearConfig)表数据库访问层
 *
 * @author linzi
 * @since 2024-08-10 13:59:26
 */
public interface ExperimentYearConfigMapper extends BaseMapper<ExperimentYearConfig> {
    /**
     * 获取所有
     *
     * @param entity
     * @return
     */
    List<ExperimentYearConfig> getList(ExperimentYearConfig entity);

    /**
     * 根据id获取
     *
     * @param id
     * @return
     */
    ExperimentYearConfig loadById(@Param("id") Long id);

    /**
     * 清空xxx年之前的试验委托配置记录
     *
     * @param year
     */
    void clearYearConfigInfo(@Param("year") Integer year);

    /**
     * 删除试验项目所有的关联关系
     *
     * @param testCode
     */
    void deleteByTestCode(@Param("testCode") String testCode);

    /**
     * 根据试验委托id查询
     *
     * @param experimentId 试验委托id
     * @return
     */
    ExperimentYearConfig selectByExperimentId(@Param("experimentId") Long experimentId);
}
